<script setup lang='ts'>
import {ref} from 'vue'

const { msg , car = '仰望u9'} = defineProps<{
    msg:string
    car?:string
}>()

console.log(car);

// const emit = defineEmits(['changeMsg','changeCar'])

const emit = defineEmits<{
    (e:'changeMsg',msg:string) : void,
    (e:'changeCar',car:string) : void,
}>()

const change = () => {
    emit('changeMsg','xiugai')
    emit('changeCar','benz')
}

const num = ref(10)

console.log(num);

// interface List {
//     id:number,
//     name:string,
//     status:boolean
// }

// const list = ref<List[]>(
//     [
//         {
//             id:1,
//             name:'harry',
//             status:false
//         }
//     ]
// )
// console.log(list.value);
const changeInput = (event:Event) => {
    console.log(event);

    console.log((event.target as HTMLInputElement).value);
}

</script>
<template>
  <div>
     <h2>{{ msg }}</h2>

     <input type="text" @change="changeInput">

     <button @click="change">修改值</button>
  </div>
</template>
<style lang='less'>
 
</style>
